<template>
        <a-table class="atable" ref="table" size="middle" rowKey="BiCode" bordered :columns="columns" :dataSource="users" :pagination="false" :loading="loading" :scroll="{x:1400, y: 200 }">
          <template style="margin-top:0px;padding-top: 0px;padding-bottom: 0px;" slot="title" slot-scope="currentPageData">
            <a href="javascript:;"  style="color: #40a9ff;font-size: 18px;font-weight: bold;">待办任务</a>
            <span v-model="count">（{{count}}）</span>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'A'===type}" @click="handleClick('A')">所有</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'FWL'===type}" @click="handleClick('FWL')">发文类</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'SWL'===type}" @click="handleClick('SWL')">收文类</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'YWL'===type}" @click="handleClick('YWL')">业务类</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'O'===type}" @click="handleClick('O')">其他</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="javascript:;" class="aText" :class="{'active':'ADD'===type}" @click="addClick('ADD')">新增</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <span style="margin-top:0;">数据加载中...</span>
            <a href="javascript:;" style="margin-top:0;color: #40a9ff;font-size: 18px;font-weight: bold;float: right;margin-right: 30px;">更多...</a>
            <hr/>
            <p style="margin-bottom: 0px;">计时图例：[-]不计时&nbsp;&nbsp;[&nbsp;&nbsp;]正常&nbsp;&nbsp;
              [<input style="width: 15px;height: 15px;background-color: #FC0;"/>]预警&nbsp;&nbsp;
              [<input style="width: 15px;height: 15px;background-color: #ff8000;"/>]警告&nbsp;&nbsp;
              [<input style="width: 15px;height: 15px;background-color: #A52;"/>]超期&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;报建编号图例：
              [<input style="width: 15px;height: 15px;background-color: #ff0000;"/>]加急&nbsp;&nbsp;
              [<input style="width: 15px;height: 15px;background-color: #00ff00;"/>]暂停&nbsp;&nbsp;
              [<input style="width: 15px;height: 15px;background-color: #0000ff;"/>]正常</p>
          </template>
        </a-table>

</template>

<script>
  export default {
    name: "commform1",
    data() {
      return {
        titleColor:false,
        count:0,
        loading:false,
        type:'',
        columns:[
          { title: '计时',  dataIndex: 'Tstate',align: 'center',width:200,},
          { title: '时限', dataIndex: 'Expfate', align: 'center', width:200,},
          { title: '报建编号', dataIndex: '报建编号', align: 'center',width:200,},
          { title: '项目名称', dataIndex: '项目名称', align: 'center',width:200, scopedSlots: {customRender: 'dataContent'},},
          { title: '事项一环节', dataIndex: '项目类别', align: 'center',width:200, },
          { title: '发送人', dataIndex: '发送人', align: 'center',width:200,},
          { title: '接收时间', dataIndex: '接收时间', align: 'center',},
        ],
        users:[]
      }
    },
    mounted(){
      this.getAdminList('A');
      this.type = 'A';
    },
    create(){
    },
    methods:{
      addClick(a){
        this.type = a;
      },
      handleClick(a){
        this.getAdminList(a);
        this.type = a;
      },
      getAdminList(type){
        let that = this;
        let params = {
          serviceName:"Xinfo.Bus.BL.Service.EgovPlatform.PortalLet.TaskOfWaitingPortalLetService,Xinfo.Bus.BL.Service",
          guid:'rcgz_dbrw',
          getCount:true,
          intTypeId:0,
          strBizType:type,
          TaskType:1
        }
        this.loading=true;
        this.getRequest("/PortalLet/GetPortalLetData",params)
          .then(res => {
            console.log(res)
            that.loading = false;
            that.users = res.data;
            that.count = res.data.length;
          })
          .catch(error => {
            that.loading = false;
            this.$message.error(error);
          });
      }
    }
  }
</script>
<style>
  .aText{
    color: #40a9ff;
    font-size: 14px;
    font-weight: bold;
  }

  .active{
    color: #ff8000  !important;
  }

</style>
